<!DOCTYPE HTML>
<html lang="en" >
    
    <head>
        
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=11; IE=10; IE=9; IE=8; IE=7; IE=EDGE" />
        <title>发布到github仓库 | Gitbook 入门教程</title>
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <meta name="description" content="">
        <meta name="generator" content="GitBook 2.0.1">
        
        
        <meta name="HandheldFriendly" content="true"/>
        <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
        <meta name="apple-mobile-web-app-capable" content="yes">
        <meta name="apple-mobile-web-app-status-bar-style" content="black">
        <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
        <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">
        
    
    
    <link rel="next" href="../publish/gitpages.html" />
    
    
    <link rel="prev" href="../publish/gitbook.html" />
    

        
    </head>
    <body>
        
        
    <link rel="stylesheet" href="../gitbook/style.css">
    
    

        
    <div class="book" data-level="4.2" data-basepath=".." data-revision="Mon Apr 13 2015 22:06:22 GMT+0800 (中国标准时间)">
    

<div class="book-summary">
    <div class="book-search">
        <input type="text" placeholder="Type to search" class="form-control" />
    </div>
    <ul class="summary">
        
        
        
        

        

        
    
        <li class="chapter " data-level="0" data-path="index.html">
            
                
                    <a href="../index.html">
                        <i class="fa fa-check"></i>
                        
                        Introduction
                    </a>
                
            
            
        </li>
    
        <li class="chapter " data-level="1" data-path="howtouse/index.html">
            
                
                    <a href="../howtouse/index.html">
                        <i class="fa fa-check"></i>
                        
                            <b>1.</b>
                        
                        基本安装
                    </a>
                
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.1" data-path="howtouse/Nodejsinstall.html">
            
                
                    <a href="../howtouse/Nodejsinstall.html">
                        <i class="fa fa-check"></i>
                        
                            <b>1.1.</b>
                        
                        Node.js安装
                    </a>
                
            
            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="howtouse/gitbookinstall.html">
            
                
                    <a href="../howtouse/gitbookinstall.html">
                        <i class="fa fa-check"></i>
                        
                            <b>1.2.</b>
                        
                        Gitbook安装
                    </a>
                
            
            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="howtouse/gitbookcli.html">
            
                
                    <a href="../howtouse/gitbookcli.html">
                        <i class="fa fa-check"></i>
                        
                            <b>1.3.</b>
                        
                        Gitbook命令行速览
                    </a>
                
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2" data-path="book/index.html">
            
                
                    <a href="../book/index.html">
                        <i class="fa fa-check"></i>
                        
                            <b>2.</b>
                        
                        图书编辑
                    </a>
                
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.1" data-path="book/gitbook-cli.html">
            
                
                    <a href="../book/gitbook-cli.html">
                        <i class="fa fa-check"></i>
                        
                            <b>2.1.</b>
                        
                        gitbook命令行&amp;markdown编辑
                    </a>
                
            
            
        </li>
    
        <li class="chapter " data-level="2.2" data-path="book/editor.html">
            
                
                    <a href="../book/editor.html">
                        <i class="fa fa-check"></i>
                        
                            <b>2.2.</b>
                        
                        gitbook editor编辑
                    </a>
                
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="3" data-path="output/index.html">
            
                
                    <a href="../output/index.html">
                        <i class="fa fa-check"></i>
                        
                            <b>3.</b>
                        
                        图书输出
                    </a>
                
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="3.1" data-path="output/outfile.html">
            
                
                    <a href="../output/outfile.html">
                        <i class="fa fa-check"></i>
                        
                            <b>3.1.</b>
                        
                        输出为静态网站
                    </a>
                
            
            
        </li>
    
        <li class="chapter " data-level="3.2" data-path="output/pdfandebook.html">
            
                
                    <a href="../output/pdfandebook.html">
                        <i class="fa fa-check"></i>
                        
                            <b>3.2.</b>
                        
                        输出PDF
                    </a>
                
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="4" data-path="publish/index.html">
            
                
                    <a href="../publish/index.html">
                        <i class="fa fa-check"></i>
                        
                            <b>4.</b>
                        
                        发布
                    </a>
                
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="4.1" data-path="publish/gitbook.html">
            
                
                    <a href="../publish/gitbook.html">
                        <i class="fa fa-check"></i>
                        
                            <b>4.1.</b>
                        
                        发布到gitbook.com
                    </a>
                
            
            
        </li>
    
        <li class="chapter active" data-level="4.2" data-path="publish/github.html">
            
                
                    <a href="../publish/github.html">
                        <i class="fa fa-check"></i>
                        
                            <b>4.2.</b>
                        
                        发布到github仓库
                    </a>
                
            
            
        </li>
    
        <li class="chapter " data-level="4.3" data-path="publish/gitpages.html">
            
                
                    <a href="../publish/gitpages.html">
                        <i class="fa fa-check"></i>
                        
                            <b>4.3.</b>
                        
                        发布到Github Pages
                    </a>
                
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="5" data-path="end/index.html">
            
                
                    <a href="../end/index.html">
                        <i class="fa fa-check"></i>
                        
                            <b>5.</b>
                        
                        结束
                    </a>
                
            
            
        </li>
    


        
        <li class="divider"></li>
        <li>
            <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
                Published with GitBook
            </a>
        </li>
        
    </ul>
</div>

    <div class="book-body">
        <div class="body-inner">
            <div class="book-header">
    <!-- Actions Left -->
    <a href="#" class="btn pull-left toggle-summary" aria-label="Table of Contents"><i class="fa fa-align-justify"></i></a>
    <a href="#" class="btn pull-left toggle-search" aria-label="Search"><i class="fa fa-search"></i></a>
    
    <div id="font-settings-wrapper" class="dropdown pull-left">
        <a href="#" class="btn toggle-dropdown" aria-label="Font Settings"><i class="fa fa-font"></i>
        </a>
        <div class="dropdown-menu font-settings">
    <div class="dropdown-caret">
        <span class="caret-outer"></span>
        <span class="caret-inner"></span>
    </div>

    <div class="buttons">
        <button type="button" id="reduce-font-size" class="button size-2">A</button>
        <button type="button" id="enlarge-font-size" class="button size-2">A</button>
    </div>

    <div class="buttons font-family-list">
        <button type="button" data-font="0" class="button">Serif</button>
        <button type="button" data-font="1" class="button">Sans</button>
    </div>

    <div class="buttons color-theme-list">
        <button type="button" id="color-theme-preview-0" class="button size-3" data-theme="0">White</button>
        <button type="button" id="color-theme-preview-1" class="button size-3" data-theme="1">Sepia</button>
        <button type="button" id="color-theme-preview-2" class="button size-3" data-theme="2">Night</button>
    </div>
</div>

    </div>

    <!-- Actions Right -->
    
    <div class="dropdown pull-right">
        <a href="#" class="btn toggle-dropdown" aria-label="Share"><i class="fa fa-share-alt"></i>
        </a>
        <div class="dropdown-menu font-settings dropdown-left">
            <div class="dropdown-caret">
                <span class="caret-outer"></span>
                <span class="caret-inner"></span>
            </div>
            <div class="buttons">
                <button type="button" data-sharing="twitter" class="button">
                    Share on Twitter
                </button>
                <button type="button" data-sharing="google-plus" class="button">
                    Share on Google
                </button>
                <button type="button" data-sharing="facebook" class="button">
                    Share on Facebook
                </button>
                <button type="button" data-sharing="weibo" class="button">
                    Share on Weibo
                </button>
                <button type="button" data-sharing="instapaper" class="button">
                    Share on Instapaper
                </button>
            </div>
        </div>
    </div>
    

    
    <a href="#" target="_blank" class="btn pull-right google-plus-sharing-link sharing-link" data-sharing="google-plus" aria-label="Google"><i class="fa fa-google-plus"></i></a>
    
    
    <a href="#" target="_blank" class="btn pull-right facebook-sharing-link sharing-link" data-sharing="facebook" aria-label="Facebook"><i class="fa fa-facebook"></i></a>
    
    
    <a href="#" target="_blank" class="btn pull-right twitter-sharing-link sharing-link" data-sharing="twitter" aria-label="Twitter"><i class="fa fa-twitter"></i></a>
    
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="../" >Gitbook 入门教程</a>
    </h1>
</div>

            <div class="page-wrapper" tabindex="-1">
                <div class="page-inner">
                
                
                    <section class="normal" id="section-">
                    
                        <h1 id="%E5%8F%91%E5%B8%83%E5%88%B0github%E4%BB%93%E5%BA%93">&#x53D1;&#x5E03;&#x5230;github&#x4ED3;&#x5E93;</h1>
<p><a href="gitbook.com">GitBook.com</a> &#x4E3A;&#x6BCF;&#x672C;&#x4E66;&#x7C4D;&#x90FD;&#x521B;&#x5EFA;&#x4E86;&#x4E00;&#x4E2A; Git &#x9879;&#x76EE;&#xFF0C;&#x5E76;&#x4E14;&#x4F7F;&#x7528;&#x8FD9;&#x4E2A; Git &#x9879;&#x76EE;&#x6765;&#x7BA1;&#x7406;&#x4E66;&#x7C4D;&#x6E90;&#x7801;&#xFF08;&#x6CE8;&#x610F;&#xFF1A;&#x8FD9;&#x91CC;&#x7684;&#x6E90;&#x7801;&#x662F;&#x6307;&#x6240;&#x6709;&#x7528;&#x6237;&#x63D0;&#x4EA4;&#x7684;&#x5185;&#x5BB9;&#xFF09;&#x3002;&#x6B63;&#x5982;&#x5728; <em>&#x7F16;&#x8F91;&#x4E66;&#x7C4D;</em> &#x4E2D;&#x4ECB;&#x7ECD;&#x7684;&#x90A3;&#x6837;&#xFF0C;&#x6211;&#x4EEC;&#x53EF;&#x4EE5;&#x901A;&#x8FC7;&#x5411;&#x4E66;&#x7C4D;&#x7684; Git &#x9879;&#x76EE;&#x63D0;&#x4EA4;&#x5185;&#x5BB9;&#x6765;&#x66F4;&#x65B0;&#x4E66;&#x7C4D;&#x3002;</p>
<p>&#x53E6;&#x5916;&#xFF0C;GitBook.com &#x8FD8;&#x53EF;&#x4EE5;&#x96C6;&#x6210; GitHub&#xFF0C;&#x6240;&#x4EE5;&#x7528;&#x6237;&#x53EF;&#x4EE5;&#x5C06;&#x4E66;&#x7C4D;&#x7684;&#x6E90;&#x7801;&#x901A;&#x8FC7; GitHub &#x4E0A;&#x7684;&#x9879;&#x76EE;&#x6765;&#x7BA1;&#x7406;(&#x800C;&#x4E14;&#x5728;github&#x4E0A;&#x7F16;&#x8F91;&#x65F6;&#x4E5F;&#x53EF;&#x4EE5;&#x540C;&#x6B65;&#x5230;GitBook.com&#x4E0A;&#x5BF9;&#x5E94;&#x7684;&#x4ED3;&#x5E93;)&#xFF0C;&#x8FD9;&#x6837;&#x53EF;&#x4EE5;&#x4F7F;&#x7528; GitHub &#x5E26;&#x6765;&#x7684;&#x5404;&#x79CD;&#x4F18;&#x70B9;&#xFF0C;&#x4F8B;&#x5982;&#xFF1A;</p>
<ul>
<li>&#x5176;&#x5B83;&#x7528;&#x6237;&#x53EF;&#x4EE5; fork</li>
<li>&#x7528;&#x6237;&#x53EF;&#x4EE5;&#x70B9;&#x8D5E;&#xFF0C;&#x83B7;&#x5F97;&#x66F4;&#x65B0;&#x63D0;&#x9192;</li>
<li>&#x7528;&#x6237;&#x53EF;&#x4EE5;&#x8D21;&#x732E;&#x81EA;&#x5DF1;&#x7684;&#x5185;&#x5BB9;</li>
</ul>
<p>&#x7B49;&#x7B49;</p>
<p>&#x8FD9;&#x91CC;&#xFF0C;&#x63A5;&#x7740;&#x4E4B;&#x524D;&#x7684;&#x5B9E;&#x4F8B;&#xFF0C;&#x5C06;&#x4F7F;&#x7528; GitHub &#x4E2D;&#x7684;&#x9879;&#x76EE;&#x6765;&#x66FF;&#x4EE3; GitBook.com &#x4E0A;&#x7684;&#x9879;&#x76EE;:<a href="https://git.gitbook.com/yuzeshan/gitbook-studying.git.&#x5206;&#x4E3A;&#x4EE5;&#x4E0B;&#x4E09;&#x5927;&#x6B65;&#x9AA4;" target="_blank">https://git.gitbook.com/yuzeshan/gitbook-studying.git.&#x5206;&#x4E3A;&#x4EE5;&#x4E0B;&#x4E09;&#x5927;&#x6B65;&#x9AA4;</a>:</p>
<h2 id="%E5%9C%A8github%E4%B8%8A%E5%88%9B%E5%BB%BA%E4%BB%93%E5%BA%93%EF%BC%8C%E5%B9%B6%E8%AE%BE%E7%BD%AE">&#x5728;Github&#x4E0A;&#x521B;&#x5EFA;&#x4ED3;&#x5E93;&#xFF0C;&#x5E76;&#x8BBE;&#x7F6E;</h2>
<ul>
<li>&#x767B;&#x5F55;Github&#x8D26;&#x6237;&#xFF0C;&#x521B;&#x5EFA;&#x4ED3;&#x5E93;<code>gitbook-studying</code>;</li>
<li>&#x663E;&#x793A;&#x5982;&#x4E0B;:<img src="../imgs/git_repository.png" alt=""></li>
</ul>
<h2 id="%E5%9C%A8gitbook-com%E4%B8%8A%E4%B8%BA%E8%AF%A5%E9%A1%B9%E7%9B%AE%E8%AE%BE%E7%BD%AEgithub%E9%9B%86%E6%88%90">&#x5728;Gitbook.com&#x4E0A;&#x4E3A;&#x8BE5;&#x9879;&#x76EE;&#x8BBE;&#x7F6E;Github&#x96C6;&#x6210;</h2>
<p>&#x9996;&#x5148;&#xFF0C;&#x5230;Gitbook.com&#x9875;&#x9762;&#xFF0C;&#x5C06;&#x4E66;&#x7C4D;&#x7684; Git &#x9879;&#x76EE;&#x8BBE;&#x7F6E;&#x4E3A; GitHub &#x4E0A;&#x7684;&#x9879;&#x76EE;&#xFF0C;&#x8FDB;&#x5165;&#x4E66;&#x7C4D;&#x5C5E;&#x6027;&#x9875;&#x9762;&#xFF0C;&#x627E;&#x5230; &quot;GitHub&quot; &#x56FE;&#x6807;&#xFF0C;&#x5982;&#x4E0B;&#x56FE;&#xFF1A;</p>
<p><img src="../imgs/gitbook_github.png" alt=""></p>
<p>&#x8F93;&#x5165;&#x5C06;&#x8981;&#x4F7F;&#x7528;&#x7684; GitHub &#x4E0A;&#x7684;&#x9879;&#x76EE;&#xFF0C;&#x6CE8;&#x610F;&#x662F;&#x516C;&#x5F00;&#x7684;&#x9879;&#x76EE;&#xFF0C;&#x5982;&#x4E0B;&#x56FE;&#xFF1A;</p>
<p><img src="../imgs/github_integration.png" alt=""></p>
<p>&#x4FDD;&#x5B58;&#x540E;&#xFF0C;&#x53EF;&#x4EE5;&#x770B;&#x5230;&#x4E4B;&#x524D;&#x4E0D;&#x53EF;&#x70B9;&#x51FB;&#x7684; &quot;Add a deployment webhook&quot; &#x6309;&#x94AE;&#x5DF2;&#x7ECF;&#x53EF;&#x4EE5;&#x70B9;&#x51FB;&#x4E86;&#xFF0C;&#x8FD9;&#x4E2A;&#x6309;&#x94AE;&#x8868;&#x793A;&#xFF1A;&#x6BCF;&#x5F53;&#x7528;&#x6237;&#x914D;&#x7F6E;&#x7684; GitHub &#x4E0A;&#x7684;&#x9879;&#x76EE;&#x66F4;&#x65B0;&#x65F6;&#xFF0C;&#x81EA;&#x52A8;&#x66F4;&#x65B0;Gitbook.com&#x4E66;&#x7C4D;&#xFF01;</p>
<h2 id="%E5%B0%86%E6%9C%AC%E5%9C%B0%E4%B9%A6%E7%B1%8D%E5%AF%BC%E5%85%A5github%E4%B8%8A%E5%AF%B9%E5%BA%94%E4%BB%93%E5%BA%93">&#x5C06;&#x672C;&#x5730;&#x4E66;&#x7C4D;&#x5BFC;&#x5165;Github&#x4E0A;&#x5BF9;&#x5E94;&#x4ED3;&#x5E93;</h2>
<p>&#x73B0;&#x5728;&#xFF0C;&#x5C06;&#x4E66;&#x7C4D;&#x539F;&#x6765;&#x7684; Git &#x9879;&#x76EE;&#x5185;&#x5BB9;&#x5BFC;&#x5165;&#x5230;&#x65B0;&#x5EFA;&#x7684; GitHub &#x4E2D;&#x7684;&#x9879;&#x76EE;&#x4E2D;&#xFF0C;&#x6B65;&#x9AA4;&#x5982;&#x4E0B;:</p>
<ol>
<li>&#x9996;&#x5148;&#x8FDB;&#x5165;&#x4E66;&#x7C4D;&#x76EE;&#x5F55;(<code>E:\gitbook\gitbook-studying</code>)&#xFF0C;&#x4E4B;&#x524D;&#x5982;&#x679C;&#x5DF2;&#x7ECF;&#x5728;&#x8BE5;&#x76EE;&#x5F55;&#x4E0B;&#x8FD0;&#x884C;&#x8FC7;git init&#x540E;&#xFF0C;&#x5C31;&#x4E0D;&#x8BB8;&#x518D;&#x6B21;&#x8FD0;&#x884C;;</li>
<li>&#x5C06;&#x5DF2;&#x7ECF;&#x7F16;&#x8F91;&#x597D;&#x7684;&#x4E66;&#x7C4D;&#x6587;&#x4EF6;&#xFF0C;&#x7528;git add/commit&#x547D;&#x4EE4;&#x4F9D;&#x6B21;&#x6DFB;&#x52A0;&#xFF0C;&#x63D0;&#x4EA4;&#x540E;;</li>
<li>&#x63A5;&#x4E0B;&#x6765;&#x5C06;&#x4E66;&#x7C4D;&#x4ED3;&#x5E93;&#x4E0E;&#x8FDC;&#x7A0B;github&#x8FDE;&#x63A5;&#x5230;&#x4E00;&#x8D77;&#xFF0C;&#x8FD0;&#x884C;&#x547D;&#x4EE4;:<code>git remote add github https://git.gitbook.com/yuzeshan/gitbook-studying.git</code>(&#x6CE8;&#x610F;:&#x5E76;&#x4E0D;&#x662F;git remote add origin git@github.com:yuzeshan/gitbook-studying.git)&#xFF1B;</li>
<li>&#x6700;&#x540E;&#xFF0C;&#x5C06;&#x4E66;&#x7C4D;&#x4ED3;&#x5E93;push&#x5230;github&#x4ED3;&#x5E93;&#x4E0A;&#xFF0C;&#x8FD0;&#x884C;&#x547D;&#x4EE4;&#xFF1A;<code>git push -u github master</code>;</li>
<li>git push &#x547D;&#x4EE4;&#x4E2D;&#x7684; -u &#x8868;&#x793A;&#x5C06;&#x672C;&#x5730; master &#x5206;&#x652F;&#x7684;&#x4E0A;&#x6E38;&#x5206;&#x652F;&#x8BBE;&#x7F6E;&#x4E3A; github/master&#xFF0C;&#x6240;&#x4EE5;&#x4EE5;&#x540E;&#x4FEE;&#x6539;&#x4E86;&#x672C;&#x5730; master &#x5206;&#x652F;&#x540E;&#xFF0C;git push &#x5C06;&#x63A8;&#x9001;&#x5230; github &#x4E0A;&#xFF0C;&#x800C;&#x975E;&#x539F;&#x6765;&#x7684; <code>git remote add gitbook https://git.gitbook.com/yuzeshan/gitbook-studying.git</code>&#x3002;</li>
</ol>
<p>&#x7ECF;&#x8FC7;&#x4EE5;&#x4E0A;&#x6B65;&#x9AA4;&#x540E;&#xFF0C;&#x5C31;&#x53EF;&#x4EE5;&#x5728;&#x672C;&#x5730;&#x4FEE;&#x6539;&#x6587;&#x4EF6;&#xFF0C;&#x76F4;&#x63A5;add&#xFF0C;commit&#xFF0C;&#x7136;&#x540E;push&#x4E0A;github&#x4ED3;&#x5E93;&#x4E0A;&#x5373;&#x53EF;&#xFF0C;&#x4FEE;&#x6539;github&#x4ED3;&#x5E93;&#x7684;&#x540C;&#x65F6;&#xFF0C;gitbook.com&#x4E0A;&#x5BF9;&#x5E94;&#x7684;&#x4E66;&#x7C4D;&#x4E5F;&#x4F1A;&#x540C;&#x6B65;&#x66F4;&#x65B0;.</p>

                    
                    </section>
                
                
                </div>
            </div>
        </div>

        
        <a href="../publish/gitbook.html" class="navigation navigation-prev " aria-label="Previous page: 发布到gitbook.com"><i class="fa fa-angle-left"></i></a>
        
        
        <a href="../publish/gitpages.html" class="navigation navigation-next " aria-label="Next page: 发布到Github Pages"><i class="fa fa-angle-right"></i></a>
        
    </div>
</div>

        
<script src="../gitbook/app.js"></script>

    
    <script src="../gitbook/plugins/gitbook-plugin-livereload/plugin.js"></script>
    

<script>
require(["gitbook"], function(gitbook) {
    var config = {"fontSettings":{"theme":null,"family":"sans","size":2}};
    gitbook.start(config);
});
</script>

        
    </body>
    
</html>
